/*-------------------------------------------------------------------------

***************** Modification History ***********************************
   @doc
   @module Debug.c - Header file for debug processing |
   @end
   
$Log: /SoftPay/SPK2SIM/Source/Include/SPDebug.h $ 

**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/

#ifndef DEBUG_H
#define DEBUG_H

#include <pfr.h>
#ifdef DEBUG_C
int inInitDebugPort (void);
void vdSDSDebug(const char *chFormat, ... );
#endif

int cprintf (char *fmt, ...);
int pcprintf (char *fmt, ...);
int pprintf (char *fmt, ...);

#ifdef DEBUG_ON_COM1
#define DEBUG_PORT	       "/dev/com1"
#define DEBUG_ON_COM
#endif /* DEBUG_ON_COM1 */

#ifdef DEBUG_ON_COM2
#define DEBUG_PORT	       "/dev/com2"
#define DEBUG_ON_COM
#endif /* DEBUG_ON_COM2 */

#ifdef DEBUG_ON_COM3
#define DEBUG_PORT	       "/dev/com3"
#define DEBUG_ON_COM
#endif /* DEBUG_ON_COM3 */

#ifdef DEBUG_95

    #ifdef DEBUG_ON_SDS
        #ifndef pdebug
            #define pdebug(a) vdSDSDebug a;
        #endif
    #else

		#ifdef DEBUG_ON_COM

   			/* If AX Debugger is running, you cannot use the COM port, so use Printer */
  			#ifdef EXTERN_DEBUG
  				#define pdebug(a) LOG_PRINTF(a);
   			#else
				#define pdebug(a)
	  		#endif
 		#else

 			/* If you want to use display then use display, else use the Printer     */
	  		#ifdef DEBUG_ON_DSP
   				#define pdebug(a) dprintf a;		
   			#else
   				#ifdef DEBUG_ON_PRN
	  				#define pdebug(a) pprintf a;
	  			#else
	  				#ifdef DEBUG_ON_PCOM
	  					#define pdebug(a) { LOG_PRINTF(a); pprintf a; }
	  				#else
						#define pdebug(a)
					#endif
				#endif
  			#endif

	 	#endif /* DEBUG_ON_COM */
	 	
	#endif

#else

  #define pdebug(a)

#endif /* DEBUG_95 */

#endif

